import request  from '../utils/request'


// 登录
export function loginToken (data) {
    // console.log(data);
    return request.post('/users/token', data)
}

//注册

export function Register(userName, password, repassword) {
    // console.log(data);
    return request.post('/users', { userName, password, repassword })
}


//   
export function postSelectUser (selectUser) {
    // console.log(selectUser);
    return request.post(`/users/select`, { selectUser })
}


// 查询所有用户
export function getUser (params) {
    // console.log(params);
    return request.get(`/users`, { params: params })
}

// 添加用户
export function postAddUser (userName, password, remark) {
    // console.log(userName);
    // console.log(password);
    return request.post(`/users`, { userName, password, remark })
}

// 更新用户
export function updateUser (id, datas) {
    // console.log(datas);
    // console.log(id);
    return request.put(`/users/${id}`, datas)
}


